package com.steakliu.sun.demo.client.sundemoclientspringboot.controller;

import com.steakliu.sun.demo.client.sundemoclientspringboot.component.UserServiceComponent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

/**
 * 功能说明：
 * <p>
 * Original @Author: steakliu-刘牌, 2023-01-14  22:59
 * <p>
 * Copyright (C)2020-2022  steakliu All rights reserved.
 */
@RestController
public class UserController {

    @Autowired
    UserServiceComponent userServiceComponent;

    @GetMapping("/test")
    public String test(@RequestParam String name, int count){
        long start = System.currentTimeMillis();
        long end = System.currentTimeMillis();
        //System.out.println("cost time ===========>   "+(TimeUnit.MILLISECONDS.toMillis(end - start)));
        return userServiceComponent.getUser(name);
    }
}
